//预加载设置项
let value = 1;
let dbUrl = String(get('barkUrl'));
let wholeBarkUrl = dbUrl;
let urlIsNull = true;
if(dbUrl != '' && dbUrl != null && dbUrl != 'null'){
    urlIsNull = false;
    if(wholeBarkUrl.slice(0,20) == 'https://api.day.app/'){
        dbUrl = dbUrl.slice(20);
        value = 1;
    }else if(wholeBarkUrl.slice(0,7) == 'http://'){
        dbUrl = dbUrl.slice(7);
        value = 3;
    }else if(wholeBarkUrl.slice(0,8) == 'https://'){
        dbUrl = dbUrl.slice(8);
        value = 2;
    }
}
const barkTitle = String(get('barkTitle'));
const  barkIcon = String(get('barkIcon'));
export const settings = {
    barkUrl:dbUrl,
    wholeBarkUrl:wholeBarkUrl,
    value: value.toString(),
    barkUrlIsNull: urlIsNull,
    barkTitle: barkTitle,
    barkIcon: barkIcon,
}


export function put(id,data){
    utools.dbStorage.setItem(id,data);
}

export function get(id){
    return utools.dbStorage.getItem(id);
}